//导游

var c = new Vue({
	el: "#bd",
	data: {
		glist: getGui1()
	},
	methods: {
		getGuiImgUrl(item) {
			var url = 'http://114.55.145.243:8080/img/img/' + item + '.jpg';
			//						var url = 'https://api.weixin.qq.com/cgi-bin/media/get?access_token=' + token + '&media_id=' + item;
			return url;
		},
		getGuihref(item) {
			var url = 'daoyou_detail.html?gui_id=' + item;
			//						var url = 'https://api.weixin.qq.com/cgi-bin/media/get?access_token=' + token + '&media_id=' + item;
			return url;
		},
		getage(item) {
			var age;
			switch(item) {
				case '1970':
					age = "70后"
					break;
				case '1980':
					age = "80后"
					break;
				case '1985':
					age = "85后"
					break;
				case '1990':
					age = "90后"
					break;
				case '1995':
					age = "95后"
					break;
				case '2000':
					age = "00后"
					break;
				default:
					break;
			}
			return age
		},
		getCar(item) {
			if(item == 0) {
				return "(不含车)"
			} else
				return "(含车)"
		},
		getUserClass(item) {
							if(item == "女")
								return 'woman';
							if(item == "男")
								return 'man';
							}

	}
})

function getGui1() {
	var dlist ;
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/GuideServlet/getGuideAll",
		async: false,
		xhrFields: {
			withCredentials: true
		},
		success: function(data) {
			if(data.data) {
				dlist = data.data
			} 
		},
		dataType: "json"

	})
	return dlist
}

function getGuiService(item) {
	var glist = {}
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/ServiceServlet/selectServiceByGid?",
		async: false,
		data: {
			ser_guide: item
		},
		xhrFields: {
			withCredentials: true
		},
		success: function(data) {
			if(data.status) {
				glist = data.data
			} 
				
		},
		dataType: "json"

	})
	return glist
}

function getOrders1(item) {
	var orders;
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/OrderServlet/selectOrderByGid?",
		async: false,
		data: {
			gui_id: item
		},
		xhrFields: {
			withCredentials: true
		},
		success: function(data) {
			if(data.data) {
				orders = data.data
			} else
				orders = 0
		},
		dataType: "json"

	})
	return orders
}